<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VUE Template</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h1 v-show="isShow">Hi,{{name}}</h1>
        <button @click="clickme">点我</button>
        <hr>
        <!-- 结构删除 -->
        <h2 v-if="true">Hi,{{name2}}</h2>
        <hr>

        <h2>当前的n={{n}}</h2>
        <button @click="n++">点我n++</button>
        <div v-if="n===0">Angular</div>
        <div v-else-if="n===1">React</div>
        <div v-else-if="n===2">Vue</div>
        <div v-else>hh</div>
    </div>
</body>
    <script type="text/javascript">
        
        const vm = new Vue({
            el:'#root',
            data:function(){
                return{
                    name:'trentwu',
                    name2:'xxm',
                    isShow:true,
                    n:0
                }
            },
            methods:{
                clickme(event){
                    this.isShow=!this.isShow
              }
          }
        })
    </script>
</html>